<template>
	<view >
		<newsList :list="list" @turnto="turnto"></newsList>
	</view>
</template>

<script>
	import newsList from "../../components/newsList"
	export default {
		components:{newsList},
		data() {
			return {
				list:[]
			}
		},
		onLoad() {
			this.getlist()
		},
		methods: {
			async getlist(){
				let res = await this.$myRequest({
					url:'/api/getnewslist'
				})
				this.list=res.data.message
				
			},
			
			turnto(id){
				uni.navigateTo({
					url:'/pages/newsdetail/newsdetail?id='+id					
				})
				
			}
		}
	}
</script>

<style lang="scss">

</style>
